package service.impl;

import bean.dto.VehicleChangeData;
import bean.pojo.ParkingSpace;
import bean.pojo.Vehicle;
import dao.VehicleDao;
import dao.impl.VehicleDaoImpl;
import service.VehicleService;

import java.util.List;

/**
 * service.impl
 * User: 坚持
 * Date: 2024/12/18 11:54
 * motto: 树欲静而风不止
 * Description:
 * Version: V1.0
 */
public class VehicleServiceImpl implements VehicleService {
    VehicleDao vehicleDao=new VehicleDaoImpl();
    @Override
    public Boolean add(Vehicle vehicle) {
        return vehicleDao.add(vehicle)>0;
    }

    @Override
    public Boolean deleteById(Integer vehicleId) {
        return vehicleDao.deleteById(vehicleId)>0;
    }

    @Override
    public Boolean updateVehicle(VehicleChangeData vehicleChangeData) {
        return vehicleDao.updateVehicle(vehicleChangeData)>0;
    }

    @Override
    public Long findByTotal(  String vehicleLicensePlate, String ownerName,String vehicleType) {
        return vehicleDao.findByTotal(vehicleLicensePlate,ownerName, vehicleType);
    }

    @Override
    public List<VehicleChangeData> findBy(Integer page, Integer limit,  String vehicleLicensePlate, String ownerName,String vehicleType) {
        return vehicleDao.findBy(page,limit,vehicleLicensePlate,ownerName, vehicleType);
    }

}
